﻿<cfsilent>
	<cfscript>
	
		event.setArg("pageTitle", "平台管理团队");
		
		targetArgs = structNew();
		
		sql = "SELECT a.group_id, a.group_name, a.group_desc  
				FROM t_group a  
				WHERE a.is_manager = '1' 
				ORDER BY a.group_id ASC";
				
		queryObj = new Query(datasource = application.dnsSlave);
		rs_group = queryObj.execute(sql=sql).getResult();
		
	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('createUserAuthorize')#</cfoutput>"><i class="mrs img btnAdd"></i><span class="uiButtonText">设置新成员</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 card"></i>管理团队
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="groupUser">
	
        <cfloop query="rs_group" >

			<cfset structInsert(targetArgs, "gid", rs_group.group_id, true) />
			
            <cfset sql = "SELECT a.user_id, b.user_name,b.user_email 
							FROM t_groupuser a  
								 INNER JOIN t_user b ON b.user_id = a.user_id 
							WHERE a.group_id = :groupId"/>
            
            <cfset queryObj = new Query(datasource = application.dnsSlave)/>
            <cfset queryObj.addParam(name="groupId", value=rs_group.group_id, cfsqltype="cf_sql_char")/>
            
            <cfset rs_user = queryObj.execute(sql=sql).getResult()/>
			
			<cfif rs_user.recordCount>
				<li>
					<div class="clearfix" id="group<cfoutput>#rs_group.group_id#</cfoutput>">
						<h2><cfoutput>#rs_group.group_name#</cfoutput></h2>
						<div class="clearfix">
							
                            <cfloop query="rs_user" >
							<cfset structInsert(targetArgs, "uid", rs_user.user_id, true) />
							<div class="UISmallUserCard">
								<div class="cardContent">
									<a href="<cfoutput>#buildURL('userAuthorizeGroup', targetArgs)#</cfoutput>"><img class="img" src="<cfoutput>#getProperty('cdnServer')#</cfoutput><cfoutput>#getContextRoot()#</cfoutput>/acadmicRes/assets/graphic/userSmall.png" style="background-image: url('<cfoutput>#getContextRoot()#</cfoutput>/acadmicManager/teacher/portrait/<cfoutput>#rs_user.user_id#</cfoutput>.jpg');"></a>
									<div class="cardDetail">
										<h3><cfoutput><a href="#buildURL('userAuthorizeGroup', targetArgs)#">#rs_user.user_name#</a> <span class="uid">(#rs_user.user_id#)</span></cfoutput></h3>
										<p><cfoutput>#rs_user.user_email#</cfoutput></p>
									</div>
								</div>
							</div>
							</cfloop>
						</div>
					</div>
				</li>
			</cfif>		
		</cfloop>
	</ul>
</div>
